<template>
  <table border="1" style="text-align:center">
    <tr>
      欢迎光临_vue开发的收银台_水果店
    </tr>
    <tr>
      苹果10￥/斤，折扣八折
    </tr>
    <tr>
      请输入你想购买的斤数<input type="text" v-model="weight">
    </tr>
    <tr>
      <button @click="buy">结账</button>
    </tr>
    <tr>
      账单：总价{{count.total}}，折后{{count.bargin}}，立省{{count.ls}}
    </tr>
  </table>
</template>

<script>
export default {
  data(){
    return{
      weight:'',
      count:{}
    }
  },
  methods:{
    buy(){
      this.count={...{
        total:this.weight*10,
        bargin:this.weight*10*0.8,
        ls:this.weight*10*0.2
      }}
    }
  }
}
</script>

<style>

</style>